<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    div {
      width: 200px;
      height: 200px;
    }
    /* n从1开始，只要有第四个元素，且是第一个，就能选中 */
    div:has(p:nth-child(3n+1))::after {
        content: "";
        display: flex;
        flex: 1 1 calc(((100% - 10px* 2) / 3)* 2 + 10px);
        min-height: 1px;
        background-color: #09fcae;
    }
  </style>
</head>
<body>
  <div>
    <p>1</p>
    <p>12</p>
    <p>12</p>
    <p>41</p>
  </div>
</body>
</html>